package com.easy.west.westclient.api.message.api;

import com.easy.west.westclient.api.base.bean.SuccessBean;
import com.easy.west.westclient.api.message.bean.MessgaeList;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;

/**
 * 消息服务
 * Created by xiatao on 2018/8/30.
 */

public interface MessageService
{
    /**
     * 查找所有用户
     * @param uid 用户id
     * @return
     */
    @GET("messages/findByUid/{uid}")
    Call<MessgaeList> findAllMessage(@Path("uid")long uid);

    /***
     * 创建消息接口
     * @param tilte
     * @param content
     * @param type
     * @param userid
     * @param important
     * @return
     */
    @FormUrlEncoded
    @POST("messages/create")
    Call<SuccessBean> createMessage(@Field("title")String tilte,@Field("content")String content
    ,@Field("type")String type,@Field("userid")int userid,@Field("isImportant")int important);

    /**
     * 标记消息已读
     * @param mesid
     * @return
     */
    @FormUrlEncoded
    @PUT("messages/isread")
    Call<SuccessBean> readMessage(@Field("mesid")long mesid);

}
